<div style="min-height: 282px">
    <ul class="list">
        <?php if(count($inboxes)): ?>
        <?php foreach($inboxes as $inbox):?>
        <li>
            <div class="list_main_container <?php if($inbox->date_read == null AND !(isset($message_id) AND $message_id == $inbox->id)) echo 'unread'; elseif(isset($message_id) AND $message_id == $inbox->id) echo 'active' ?>">
                <img src="<?php echo $inbox->photo ?>" alt="<?php echo $inbox->name.' '.$inbox->surname ?>"/>
                <div class="list_user_link"><a href="/desktop/<?php echo $inbox->url ?>" class="desktop_link" title="<?php echo __('show desktop') ?>"></a><a href="/profile/<?php echo $inbox->url ?>" class="profile_link" title="<?php echo __('show profile') ?>"></a></div>
                <div class="list_standard_entre" style="width:50px"><?php echo __('From') ?>:</div>
                <a href="/message/inbox/<?php echo $inbox->id ?>" class="message_link">
                <div class="message_row">
                    <p class="mini_name ellipsis_character"><?php echo $inbox->name.' '.$inbox->surname ?></p>
                    <p class="mini_info ellipsis_word"><span><?php echo $inbox->subject ?></span> - <?php echo $inbox->content_message; ?></p>
                </div>
                </a>
                <div class="list_standard_entre" style="width: 85px;text-align:center;font-size: 10px"><?php echo   Date::nice_span(strtotime($inbox->date_created)) ?></div>
                <div class="list_standard_entre"><a href="/message/delete_inbox_message/<?php echo $inbox->id ?>" class="tooltip delete" title="<?php echo __('move to bin'); ?>" rel="<?php echo __('move to bin|Are you realy want move this message to bin ?|Move to bin|Cancel') ?>"></a></div>
            </div>
            <div class="message" <?php if(!(isset($message_id) AND $message_id == $inbox->id)) echo 'style="display:none"'?>>
                <h1><?php  echo $inbox->subject ?></h1>
                <?php  echo Text::auto_p($inbox->content_message);?>
                <hr/>
                <a href="#" class="btn_answer"><?php echo __('answer')?></a>
                <?php echo Form::open('message/send_message', array('id'    => 'form_'.$inbox->id,
                                                                    'class' => 'standard_form', 
                                                                    'style' => 'margin-left: -15px; display:none;')) ?>
                        <div>
                            <?php echo Form::hidden('inbox_id', $inbox->id); ?>
                            <?php echo Form::hidden('recipient', $inbox->user_id); ?>
                            <?php echo Form::label('subject_'.$inbox->id, __('Subject').'*:') ?>
                            <?php echo Form::input('subject', 'Re: '.Text::limit_chars($inbox->subject, 123), array('id'    => 'subject_'.$inbox->id,
                                                                                            'class' => 'standard_text_form')) ?>
                            <div style="clear: both"></div>
                        </div>

                   
                        <div>
                            <?php echo Form::label('content_message_'.$inbox->id,__('Content').'*:') ?>
                            <?php echo Form::textarea('content_message', null, array('class' => 'standard_textarea_form', 
                                                                                     'id'    => 'content_message_'.$inbox->id  )) ?>
                            <div style="clear: both"></div>

                            <?php echo Form::submit('send', __('Send message'), array('class' => 'button_blue',
                                                                                      'style' => 'margin-left:130px')) ?>
                        </div>
               
                <?php echo Form::close() ?>
            </div>
	</li>
        <?php endforeach ?>
        <?php else: ?>
            <li>
                <div class="list_main_container">
                    <div class="list_standard_entre" style="text-align: center; float: none"><?php echo __('no messages in inbox to show') ?></div>                   
                </div>
            </li>
        <?php endif ?>
    </ul>
</div>
